<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">


<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link type="text/css" rel="stylesheet" href="themes/bootstrap/easyui.css">
<link type="text/css" rel="stylesheet" href="themes/icon.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>

<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/index.css">

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="bootstrap/js/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- 为了确保适当的绘制和触屏缩放-->
<meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<script type="text/javascript">
$(function(){
	$("#add").click(function(){
		$("#dataShow").hide();
		$("#addEmpOvertime").show();
	});
	$("#del").click(function(){
		var tds=$("input:checked").parent().next();
		var sids="";
		$.each(tds,function(i){
			sids+=$(this).text()+",";
		});
		var newStr=sids.substring(0,sids.length-1);
		window.location.href="deleteEmpOvertime?sids="+newStr.trim();
	});
});
</script>
<body>
<div class="container">
<div class="row">
	<div class="col-md-12">
	<div>
		<ol class="breadcrumb">
			<li><a  href="welcome.jsp">首页</a></li>
			<li>员工信息管理</li>
			<li>员工加班记录管理</li>
		</ol>
	</div>
	<div id="dataShow" style="position: absolute" class="col-md-12">
	<div>
		<button type="button" class="btn btn-primary" id="add">添加</button>
		<button type="button" class="btn btn-info" id="del">删除</button>
	</div>
    <c:choose>
   			 <c:when test="${!empty ovetimeDtos}">
                 <h3>加班记录展示</h3>
    			</c:when>
    		<c:otherwise>
      			  <strong>对不起,你现在还没有加班记录</strong>
   			 </c:otherwise>
		</c:choose>
	<table  class="table table-striped" id="table" >
	<tr class="active">
	<td>编号</td>
	 <td><input type="checkbox" id="allCheckBoks"></td>
	 <td style="display: none">ID</td>
	 <td>姓名</td>
	 <td>加班开始时间</td>
	 <td>加班天数</td>
	 <td>加班原因</td>
	</tr>
	<c:forEach var="ovetimeDto" items="${ovetimeDtos}" varStatus="vs">
	<tr>
	<td>${vs.count}</td>
	<td><input type="checkbox"></td>
	<td style="display: none">${ovetimeDto.id}</td>
	<td>${ovetimeDto.name}</td>
	<td>${ovetimeDto.startDate}</td>
	<td>${ovetimeDto.days}</td>
	<td>${ovetimeDto.reason}</td>
	</tr>
	</c:forEach>
		</table>
		 <div>
		  <ul class="pagination">
			      ${pageList}
  		  </ul>
  		  <h3>${erro}</h3>
  		  </div>
	</div>
	</div>
	<div id="addEmpOvertime" style="position: absolute;display: none;margin-top: 75px" class="col-md-6 col-md-offset-2">
	<form action="addEmpOvertime" method="post" class="form-horizontal">
	<div class="form-group">
    		 <label for="addaccount">工号</label>
             <input type="text" class="form-control" id="addaccount" name="addaccount" placeholder="输入工号">
             </div>
         <div class="form-group">
             <label for="addstartdate">加班开始时间</label>
             <input type="text" class="form-control" id="addstartdate" name="addstartdate" placeholder="输入加班开始时间">
         </div>
         <div class="form-group">
             <label for="adddays">加班天数</label>
             <input type="text" class="form-control" id="adddays" name="adddays" placeholder="输入加班天数">
         </div>
         <div class="form-group">
             <label for="addreason">加班原因</label>
             <input type="text" class="form-control" id="addreason" name="addreason" placeholder="输入加班原因">
         </div>
             <button id="addsubmit" type="submit" class="btn btn-default">提交</button>
	</form>
	</div>
	</div>
	</div>
</body>
</html>